﻿#include "../../libcat/include/cat-module.hpp"
#include "../../libcat/include/util/json.h"
#include "../../liblive2d/include/catlive2d.hpp"
#include "rtsp-server.hpp"

namespace {
	
}


void* Init(cat_data_t* settings) {

	RtspServer::GetInstance()->Init(settings->json);

	return settings;
}
void* Release() {
	RtspServer::GetInstance()->Release();
	return NULL;
};

void* Run(void* _window) {
	
	RtspServer::GetInstance()->Draw(_window);
	return _window;
};

CAT_DECLARE_MODULE()
bool cat_module_load (){
	cat_source_info a {};
	a.id = 100;
	a.type = CAT_SOURCE_TYPE_OUTPUT;
	a.Init = Init;
	a.Release = Release;
	a.Run = Run;

	cat_register_source(&a);
	return true;
}
